﻿define(['util', 'ajax'], function (util, ajax) {
    "use strict";

    var exports = {}, ViewModel;

    ViewModel = function () {
        var self = this;

        self.token = ko.observable();
        self.newpassword = ko.observable();
        self.confirmpassword = ko.observable();
        self.resetPassword = function () {
            var form = {
                Token: self.token(),
                NewPassword: self.newpassword(),
                ConfirmPassword: self.confirmpassword(),
            };
            ajax.put('authRecovery', form);
        };
    };

    exports.exec = function () {
        var viewModel = new ViewModel();
        ko.applyBindings(viewModel, document.getElementById('sign-reset-form'));
    };

    return exports;
});